package fanxing;

import java.util.Arrays;

public class MyArrayList<E> {
    Object[] obj=new Object[10];//定义数组
    int size;
    public boolean add(E a){//增加
        obj[size]=a;
        size++;
        return true;
    }
    public E get(int index){//查找
        return (E)obj[index];
    }

    @Override
    public String toString() {
        return "MyArrayList{" +
                "obj=" + Arrays.toString(obj) +
                ", size=" + size +
                '}';
    }
}
